package com.welsy.authoring.business
{
	import mx.rpc.Fault;
	import mx.rpc.events.FaultEvent;
	import mx.rpc.events.ResultEvent;
	import mx.rpc.soap.mxml.WebService;	
	import mx.rpc.AbstractOperation;
	import com.adobe.cairngorm.business.ServiceLocator;
	import mx.rpc.IResponder;
	import mx.rpc.AsyncToken;
	import flash.utils.setTimeout;	
	import com.welsy.authoring.vo.CourseVO;
	import mx.collections.XMLListCollection;
	import com.welsy.authoring.vo.CourseComponentsVO;			

	/**
	 * @version	$Revision: 1.1 $
	 */
	public class GetFinalResultDelegate
	{
		public function GetFinalResultDelegate( responder : IResponder )
		{		
			this.service = ServiceLocator.getInstance().getWebService("UserTestResultsService") as WebService;			
			this.responder = responder;
		}
										
		public function getFinalResult(userId : String, testId : String) : void
		{			
			var ao : AbstractOperation = service.getOperation("GetFinalResult");
			ao.arguments.GetFinalResultRequest.UserId = userId;
			ao.arguments.GetFinalResultRequest.TestId = testId;
			
			var token:AsyncToken = service.GetFinalResult();
			// notify this command when the service call completes
			token.addResponder( responder );
		}	
		
		private var responder : IResponder;
		private var service : Object;
	}

}